<template>
	<tm-app>

		<tm-sheet :round="3" :margin="[32, 32, 32, 32]" :shadow="4" color="yellow" linear="right" liearDeep="accent">


			<tm-row :column="10">
				<tm-col :col="10" :height="40" transprent="true" align="end">

					<tm-icon name="tmicon-cog-fill" @click="myMsg()"></tm-icon>
				</tm-col>
				<tm-col :col="2" :height="120" transprent="true" align="center">
					<tm-avatar :img="uuidAvatar"></tm-avatar>
				</tm-col>
				<tm-col :col="7" align="start" transprent="true">
					<tm-col :col="2" :height="40" transprent="true" style="margin-top: -7px;">
						<tm-text>{{nickname}}</tm-text>
					</tm-col>
					<tm-col :col="2" :height="40" transprent="true" style="margin-top: 5px;">
						<tm-text>{{account}}</tm-text>
					</tm-col>
				</tm-col>

				<tm-col :col="10" transprent="true">
					<tm-text>区块链地址:{{nativeAddress}}</tm-text>
				</tm-col>
				<tm-col :col="10" transprent="true">
					<tm-divider></tm-divider>
				</tm-col>

				<tm-col _class="flex flex-row flex-row-center-center" :col="5" :height="80" transprent="true">
					<view class="flex-1 flex flex-row flex-row-center-center">
						<tm-button icon="tmicon-collection-fill" size="normal" :round="5" label="我的藏品" @tap="goMyNft()"
							color="white"></tm-button>
					</view>
				</tm-col>
				<tm-col :col="5" :height="80" transprent="true">
					<view class="flex-1 flex flex-row flex-row-center-center">
						<tm-button icon="tmicon-qiandai" size="normal" :round="5" label="我的钱包"
							color="white"></tm-button>
					</view>
				</tm-col>
			</tm-row>

		</tm-sheet>

		<view class="mb-32 mx-32 round-3 overflow">
			<tm-cell :margin="[0, 0]" :titleFontSize="30" title="我的订单" @tap="goToOrder()"></tm-cell>
			<tm-cell :margin="[0, 0]" :titleFontSize="30" title="我的认证" :rightText="status" @click="getKyc()"> </tm-cell>
			<tm-cell :margin="[0, 0]" :titleFontSize="30" title="关于我们"> </tm-cell>
		</view>




	</tm-app>




</template>
<script>
	import tmApp from '@/tmui/components/tm-app/tm-app.vue'
	import tmSheet from '@/tmui/components/tm-sheet/tm-sheet.vue'
	import tmText from '@/tmui/components/tm-text/tm-text.vue'
	export default {
		data() {
			return {
				id: '',
				phone: '',
				uuidAvatar: '',
				nickname: '',
				account: '',
				nativeAddress: '',
				status: ''
			}
		},
		onLoad() {
			this.getMb();
		},
		methods: {
			goMyNft() {
				uni.navigateTo({
					url: `/pages/myPage/myNft`
				});
			},
			//跳转个人详情界面
			myMsg() {
				uni.navigateTo({
					url: '/pages/myPage/myMsg'
				});



			},
			goToOrder() {
				uni.navigateTo({
					url: `/pages/order/order`
				});
			},
			//跳转我的认证界面
			getKyc() {
				

				

				if (this.status == '未认证') {
					uni.navigateTo({

						url: '/pages/myPage/kycPage?data=' + this.id
					});
				} else if (this.status == '已认证') {
					uni.navigateTo({
						url: '/pages/myPage/getKycPage?data=' + this.id
					});

				}






			},
			//查看用户信息
			getMb() {

				uni.request({
					url: "/app/mb/getMbInfo.do",
					method: 'GET',
					header: { // 设置请求的header
						'content-type': 'application/json', // 指定请求头，比如设置Content-Type
					},
					success: (res) => {
						let requ = res.data.data;
						this.id = requ.id;
						this.uuidAvatar = requ.uuidAvatar;
						this.nickname = requ.nickname;
						this.account = requ.account;
						this.nativeAddress = requ.nativeAddress;
						this.phone = requ.phone;
						
						if (requ.isKyc == 0) {
							this.status = '未认证'
						} else {
							this.status = '已认证'
						}


						// 在请求成功时返回的数据
					}

				})

			}
		}
	}
</script>